import sys
import os
from PyQt5.QtWidgets import QApplication, QSystemTrayIcon, QMessageBox
from PyQt5.QtGui import QPainter, QPixmap, QColor, QFont
from module.FloatingBall import FloatingBall

if __name__ == "__main__":
    app = QApplication(sys.argv)
    path = os.path.dirname(os.path.abspath(__file__))
    floatingball = FloatingBall(path)
    floatingball.show()
    sys.exit(app.exec_())

if __name__ == "__main__":
    app = QApplication(sys.argv)

    if not QSystemTrayIcon.isSystemTrayAvailable():
        QMessageBox.critical(None, "错误", "您的系统不支持系统托盘功能！")
        sys.exit(1)

    font = QFont()
    font.setFamily("SimHei")
    app.setFont(font)

    path = os.path.dirname(os.path.abspath(__file__))
    floatingball = FloatingBall(path)
    floatingball.show()
    sys.exit(app.exec_())
